import axios from "axios"
import { baseUrl } from './baseUrl'
import { Toast } from "vant"

const requests = axios.create({
    baseURL: baseUrl,
    timeout: 10000
})

requests.interceptors.request.use(config => {
    return config
})

requests.interceptors.response.use(res => {
    return res.data
}, error => {
    // console.log(error)
    Toast({
        message: '请求失败',
        icon: 'cross'
    })
})

export default requests